<template>
    <template v-for="item,key in menuLists">
        <el-menu-item v-if="!item?.children?.length" :key="key" :index="item.path">
            {{ item.name }}
        </el-menu-item>
        <el-sub-menu v-else :index="item.path">
            <template #title>{{ item.name }}</template>
            <MenuItem :menuLists="item.children"></MenuItem>
        </el-sub-menu>
    </template>
</template>

<script setup>

const props = defineProps({
    menuLists: {
        type: Array,
        default: () => {
            return []
        }
    },
})

</script>